/*
 * Copyright (c) 2014-2024 Stream.io Inc. All rights reserved.
 *
 * Licensed under the Stream License;
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    https://github.com/GetStream/stream-chat-android/blob/main/LICENSE
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.getstream.chat.android.ui

import android.graphics.drawable.Drawable
import io.getstream.chat.android.models.ChannelUserRead
import io.getstream.chat.android.models.Message
import io.getstream.chat.android.models.ReactionSorting
import io.getstream.chat.android.randomBoolean
import io.getstream.chat.android.randomFloat
import io.getstream.chat.android.randomInt
import io.getstream.chat.android.randomMessage
import io.getstream.chat.android.ui.common.state.messages.list.MessagePosition
import io.getstream.chat.android.ui.feature.messages.common.AudioRecordPlayerViewStyle
import io.getstream.chat.android.ui.feature.messages.list.GiphyViewHolderStyle
import io.getstream.chat.android.ui.feature.messages.list.MessageListItemStyle
import io.getstream.chat.android.ui.feature.messages.list.MessageListView
import io.getstream.chat.android.ui.feature.messages.list.MessageListViewStyle
import io.getstream.chat.android.ui.feature.messages.list.MessageReplyStyle
import io.getstream.chat.android.ui.feature.messages.list.MessageViewStyle
import io.getstream.chat.android.ui.feature.messages.list.ScrollButtonViewStyle
import io.getstream.chat.android.ui.feature.messages.list.UnreadLabelButtonStyle
import io.getstream.chat.android.ui.feature.messages.list.adapter.MessageListItem
import io.getstream.chat.android.ui.feature.messages.list.reactions.edit.EditReactionsViewStyle
import io.getstream.chat.android.ui.feature.messages.list.reactions.view.ViewReactionsViewStyle
import io.getstream.chat.android.ui.font.TextStyle
import io.getstream.chat.android.ui.helper.ViewPadding
import io.getstream.chat.android.ui.helper.ViewSize
import org.mockito.kotlin.mock

public fun randomMessageItem(
    message: Message = randomMessage(),
    positions: List<MessagePosition> = listOf(),
    isMine: Boolean = randomBoolean(),
    messageReadBy: List<ChannelUserRead> = listOf(),
    isThreadMode: Boolean = randomBoolean(),
    isMessageRead: Boolean = randomBoolean(),
    showMessageFooter: Boolean = randomBoolean(),
): MessageListItem.MessageItem =
    MessageListItem.MessageItem(
        message = message,
        positions = positions,
        isMine = isMine,
        messageReadBy = messageReadBy,
        isThreadMode = isThreadMode,
        isMessageRead = isMessageRead,
        showMessageFooter = showMessageFooter,
    )

@Suppress("LongMethod")
public fun randomMessageListViewStyle(
    scrollButtonViewStyle: ScrollButtonViewStyle = randomScrollButtonViewStyle(),
    scrollButtonBehaviour: MessageListView.NewMessagesBehaviour = randomNewMessagesBehaviour(),
    itemStyle: MessageListItemStyle = randomMessageListItemStyle(),
    giphyViewHolderStyle: GiphyViewHolderStyle = randomGiphyViewHolderStyle(),
    audioRecordPlayerViewStyle: MessageViewStyle<AudioRecordPlayerViewStyle> = MessageViewStyle(
        own = randomAudioRecordPlayerViewStyle(),
        theirs = randomAudioRecordPlayerViewStyle(),
    ),
    replyMessageStyle: MessageReplyStyle = randomMessageReplyStyle(),
    unreadLabelButtonStyle: UnreadLabelButtonStyle = randomUnreadLabelButtonStyle(),
    reactionsEnabled: Boolean = randomBoolean(),
    backgroundColor: Int = randomInt(),
    replyIcon: Int = randomInt(),
    replyEnabled: Boolean = randomBoolean(),
    threadReplyIcon: Int = randomInt(),
    threadsEnabled: Boolean = randomBoolean(),
    retryIcon: Int = randomInt(),
    copyIcon: Int = randomInt(),
    markAsUnreadIcon: Int = randomInt(),
    editMessageEnabled: Boolean = randomBoolean(),
    editIcon: Int = randomInt(),
    flagIcon: Int = randomInt(),
    flagEnabled: Boolean = randomBoolean(),
    pinIcon: Int = randomInt(),
    unpinIcon: Int = randomInt(),
    pinMessageEnabled: Boolean = randomBoolean(),
    deleteIcon: Int = randomInt(),
    deleteMessageEnabled: Boolean = randomBoolean(),
    blockUserIcon: Int = randomInt(),
    unblockUserIcon: Int = randomInt(),
    blockUserEnabled: Boolean = randomBoolean(),
    copyTextEnabled: Boolean = randomBoolean(),
    markAsUnreadEnabled: Boolean = randomBoolean(),
    retryMessageEnabled: Boolean = randomBoolean(),
    deleteConfirmationEnabled: Boolean = randomBoolean(),
    flagMessageConfirmationEnabled: Boolean = randomBoolean(),
    messageOptionsText: TextStyle = mock(),
    warningMessageOptionsText: TextStyle = mock(),
    messageOptionsBackgroundColor: Int = randomInt(),
    userReactionsBackgroundColor: Int = randomInt(),
    userReactionsTitleText: TextStyle = mock(),
    optionsOverlayDimColor: Int = randomInt(),
    emptyViewTextStyle: TextStyle = mock(),
    loadingView: Int = randomInt(),
    messagesStart: Int = randomInt(),
    threadMessagesStart: Int = randomInt(),
    messageOptionsUserReactionAlignment: Int = randomInt(),
    scrollButtonBottomMargin: Int = randomInt(),
    scrollButtonEndMargin: Int = randomInt(),
    disableScrollWhenShowingDialog: Boolean = randomBoolean(),
    optionsOverlayEditReactionsMarginTop: Int = randomInt(),
    optionsOverlayEditReactionsMarginBottom: Int = randomInt(),
    optionsOverlayEditReactionsMarginStart: Int = randomInt(),
    optionsOverlayEditReactionsMarginEnd: Int = randomInt(),
    optionsOverlayUserReactionsMarginTop: Int = randomInt(),
    optionsOverlayUserReactionsMarginBottom: Int = randomInt(),
    optionsOverlayUserReactionsMarginStart: Int = randomInt(),
    optionsOverlayUserReactionsMarginEnd: Int = randomInt(),
    optionsOverlayMessageOptionsMarginTop: Int = randomInt(),
    optionsOverlayMessageOptionsMarginBottom: Int = randomInt(),
    optionsOverlayMessageOptionsMarginStart: Int = randomInt(),
    optionsOverlayMessageOptionsMarginEnd: Int = randomInt(),
    showReactionsForUnsentMessages: Boolean = randomBoolean(),
    readCountEnabled: Boolean = randomBoolean(),
    swipeToReplyEnabled: Boolean = randomBoolean(),
    swipeToReplyIcon: Int = randomInt(),
): MessageListViewStyle = MessageListViewStyle(
    scrollButtonViewStyle = scrollButtonViewStyle,
    scrollButtonBehaviour = scrollButtonBehaviour,
    itemStyle = itemStyle,
    giphyViewHolderStyle = giphyViewHolderStyle,
    audioRecordPlayerViewStyle = audioRecordPlayerViewStyle,
    replyMessageStyle = replyMessageStyle,
    unreadLabelButtonStyle = unreadLabelButtonStyle,
    reactionsEnabled = reactionsEnabled,
    backgroundColor = backgroundColor,
    replyIcon = replyIcon,
    replyEnabled = replyEnabled,
    threadReplyIcon = threadReplyIcon,
    threadsEnabled = threadsEnabled,
    retryIcon = retryIcon,
    copyIcon = copyIcon,
    markAsUnreadIcon = markAsUnreadIcon,
    editMessageEnabled = editMessageEnabled,
    editIcon = editIcon,
    flagIcon = flagIcon,
    flagEnabled = flagEnabled,
    pinIcon = pinIcon,
    unpinIcon = unpinIcon,
    pinMessageEnabled = pinMessageEnabled,
    deleteIcon = deleteIcon,
    deleteMessageEnabled = deleteMessageEnabled,
    blockUserIcon = blockUserIcon,
    unblockUserIcon = unblockUserIcon,
    blockUserEnabled = blockUserEnabled,
    copyTextEnabled = copyTextEnabled,
    markAsUnreadEnabled = markAsUnreadEnabled,
    retryMessageEnabled = retryMessageEnabled,
    deleteConfirmationEnabled = deleteConfirmationEnabled,
    flagMessageConfirmationEnabled = flagMessageConfirmationEnabled,
    messageOptionsText = messageOptionsText,
    warningMessageOptionsText = warningMessageOptionsText,
    messageOptionsBackgroundColor = messageOptionsBackgroundColor,
    userReactionsBackgroundColor = userReactionsBackgroundColor,
    userReactionsTitleText = userReactionsTitleText,
    optionsOverlayDimColor = optionsOverlayDimColor,
    emptyViewTextStyle = emptyViewTextStyle,
    loadingView = loadingView,
    messagesStart = messagesStart,
    threadMessagesStart = threadMessagesStart,
    messageOptionsUserReactionAlignment = messageOptionsUserReactionAlignment,
    scrollButtonBottomMargin = scrollButtonBottomMargin,
    scrollButtonEndMargin = scrollButtonEndMargin,
    disableScrollWhenShowingDialog = disableScrollWhenShowingDialog,
    optionsOverlayEditReactionsMarginTop = optionsOverlayEditReactionsMarginTop,
    optionsOverlayEditReactionsMarginBottom = optionsOverlayEditReactionsMarginBottom,
    optionsOverlayEditReactionsMarginStart = optionsOverlayEditReactionsMarginStart,
    optionsOverlayEditReactionsMarginEnd = optionsOverlayEditReactionsMarginEnd,
    optionsOverlayUserReactionsMarginTop = optionsOverlayUserReactionsMarginTop,
    optionsOverlayUserReactionsMarginBottom = optionsOverlayUserReactionsMarginBottom,
    optionsOverlayUserReactionsMarginStart = optionsOverlayUserReactionsMarginStart,
    optionsOverlayUserReactionsMarginEnd = optionsOverlayUserReactionsMarginEnd,
    optionsOverlayMessageOptionsMarginTop = optionsOverlayMessageOptionsMarginTop,
    optionsOverlayMessageOptionsMarginBottom = optionsOverlayMessageOptionsMarginBottom,
    optionsOverlayMessageOptionsMarginStart = optionsOverlayMessageOptionsMarginStart,
    optionsOverlayMessageOptionsMarginEnd = optionsOverlayMessageOptionsMarginEnd,
    showReactionsForUnsentMessages = showReactionsForUnsentMessages,
    readCountEnabled = readCountEnabled,
    swipeToReplyEnabled = swipeToReplyEnabled,
    swipeToReplyIcon = swipeToReplyIcon,
)

public fun randomScrollButtonViewStyle(
    scrollButtonEnabled: Boolean = randomBoolean(),
    scrollButtonUnreadEnabled: Boolean = randomBoolean(),
    scrollButtonColor: Int = randomInt(),
    scrollButtonRippleColor: Int = randomInt(),
    scrollButtonBadgeColor: Int? = randomInt(),
    scrollButtonElevation: Float = randomFloat(),
    scrollButtonIcon: Drawable? = null,
    scrollButtonBadgeTextStyle: TextStyle = mock(),
    scrollButtonBadgeIcon: Drawable? = null,
    scrollButtonBadgeGravity: Int = randomInt(),
    scrollButtonBadgeElevation: Float = randomFloat(),
    scrollButtonInternalMargin: Int = randomInt(),
): ScrollButtonViewStyle = ScrollButtonViewStyle(
    scrollButtonEnabled = scrollButtonEnabled,
    scrollButtonUnreadEnabled = scrollButtonUnreadEnabled,
    scrollButtonColor = scrollButtonColor,
    scrollButtonRippleColor = scrollButtonRippleColor,
    scrollButtonBadgeColor = scrollButtonBadgeColor,
    scrollButtonElevation = scrollButtonElevation,
    scrollButtonIcon = scrollButtonIcon,
    scrollButtonBadgeTextStyle = scrollButtonBadgeTextStyle,
    scrollButtonBadgeIcon = scrollButtonBadgeIcon,
    scrollButtonBadgeGravity = scrollButtonBadgeGravity,
    scrollButtonBadgeElevation = scrollButtonBadgeElevation,
    scrollButtonInternalMargin = scrollButtonInternalMargin,
)

public fun randomNewMessagesBehaviour(): MessageListView.NewMessagesBehaviour =
    MessageListView.NewMessagesBehaviour.entries.toTypedArray().random()

public fun randomMessageListItemStyle(
    messageBackgroundColorMine: Int? = randomInt(),
    messageBackgroundColorTheirs: Int? = randomInt(),
    messageLinkTextColorMine: Int? = randomInt(),
    messageLinkTextColorTheirs: Int? = randomInt(),
    messageLinkBackgroundColorMine: Int = randomInt(),
    messageLinkBackgroundColorTheirs: Int = randomInt(),
    linkDescriptionMaxLines: Int = randomInt(),
    textStyleMine: TextStyle = mock(),
    textStyleTheirs: TextStyle = mock(),
    textStyleUserName: TextStyle = mock(),
    textStyleMessageDate: TextStyle = mock(),
    textStyleMessageLanguage: TextStyle = mock(),
    textStyleThreadCounter: TextStyle = mock(),
    textStyleReadCounter: TextStyle = mock(),
    threadSeparatorTextStyle: TextStyle = mock(),
    textStyleLinkLabel: TextStyle = mock(),
    textStyleLinkTitle: TextStyle = mock(),
    textStyleLinkDescription: TextStyle = mock(),
    dateSeparatorBackgroundColor: Int = randomInt(),
    textStyleDateSeparator: TextStyle = mock(),
    reactionsViewStyle: ViewReactionsViewStyle = randomViewReactionsViewStyle(),
    editReactionsViewStyle: EditReactionsViewStyle = randomEditReactionsViewStyle(),
    iconIndicatorSent: Drawable = mock(),
    iconIndicatorDelivered: Drawable = mock(),
    iconIndicatorRead: Drawable = mock(),
    iconIndicatorPendingSync: Drawable = mock(),
    iconOnlyVisibleToYou: Drawable = mock(),
    textStyleMessageDeletedMine: TextStyle? = mock(),
    messageDeletedBackgroundMine: Int? = randomInt(),
    textStyleMessageDeletedTheirs: TextStyle? = mock(),
    messageDeletedBackgroundTheirs: Int? = randomInt(),
    messageStrokeColorMine: Int = randomInt(),
    messageStrokeWidthMine: Float = randomFloat(),
    messageStrokeColorTheirs: Int = randomInt(),
    messageStrokeWidthTheirs: Float = randomFloat(),
    textStyleSystemMessage: TextStyle = mock(),
    textStyleErrorMessage: TextStyle = mock(),
    pinnedMessageIndicatorTextStyle: TextStyle = mock(),
    pinnedMessageIndicatorIcon: Drawable = mock(),
    pinnedMessageBackgroundColor: Int = randomInt(),
    messageStartMargin: Int = randomInt(),
    messageEndMargin: Int = randomInt(),
    messageMaxWidthFactorMine: Float = randomFloat(),
    messageMaxWidthFactorTheirs: Float = randomFloat(),
    showMessageDeliveryStatusIndicator: Boolean = randomBoolean(),
    iconFailedMessage: Drawable = mock(),
    iconBannedMessage: Drawable = mock(),
    systemMessageAlignment: Int = randomInt(),
    loadingMoreView: Int = randomInt(),
    unreadSeparatorBackgroundColor: Int = randomInt(),
    unreadSeparatorTextStyle: TextStyle = mock(),
): MessageListItemStyle = MessageListItemStyle(
    messageBackgroundColorMine = messageBackgroundColorMine,
    messageBackgroundColorTheirs = messageBackgroundColorTheirs,
    messageLinkTextColorMine = messageLinkTextColorMine,
    messageLinkTextColorTheirs = messageLinkTextColorTheirs,
    messageLinkBackgroundColorMine = messageLinkBackgroundColorMine,
    messageLinkBackgroundColorTheirs = messageLinkBackgroundColorTheirs,
    linkDescriptionMaxLines = linkDescriptionMaxLines,
    textStyleMine = textStyleMine,
    textStyleTheirs = textStyleTheirs,
    textStyleUserName = textStyleUserName,
    textStyleMessageDate = textStyleMessageDate,
    textStyleMessageLanguage = textStyleMessageLanguage,
    textStyleThreadCounter = textStyleThreadCounter,
    textStyleReadCounter = textStyleReadCounter,
    threadSeparatorTextStyle = threadSeparatorTextStyle,
    textStyleLinkLabel = textStyleLinkLabel,
    textStyleLinkTitle = textStyleLinkTitle,
    textStyleLinkDescription = textStyleLinkDescription,
    dateSeparatorBackgroundColor = dateSeparatorBackgroundColor,
    textStyleDateSeparator = textStyleDateSeparator,
    reactionsViewStyle = reactionsViewStyle,
    editReactionsViewStyle = editReactionsViewStyle,
    iconIndicatorSent = iconIndicatorSent,
    iconIndicatorDelivered = iconIndicatorDelivered,
    iconIndicatorRead = iconIndicatorRead,
    iconIndicatorPendingSync = iconIndicatorPendingSync,
    iconOnlyVisibleToYou = iconOnlyVisibleToYou,
    textStyleMessageDeletedMine = textStyleMessageDeletedMine,
    messageDeletedBackgroundMine = messageDeletedBackgroundMine,
    textStyleMessageDeletedTheirs = textStyleMessageDeletedTheirs,
    messageDeletedBackgroundTheirs = messageDeletedBackgroundTheirs,
    messageStrokeColorMine = messageStrokeColorMine,
    messageStrokeWidthMine = messageStrokeWidthMine,
    messageStrokeColorTheirs = messageStrokeColorTheirs,
    messageStrokeWidthTheirs = messageStrokeWidthTheirs,
    textStyleSystemMessage = textStyleSystemMessage,
    textStyleErrorMessage = textStyleErrorMessage,
    pinnedMessageIndicatorTextStyle = pinnedMessageIndicatorTextStyle,
    pinnedMessageIndicatorIcon = pinnedMessageIndicatorIcon,
    pinnedMessageBackgroundColor = pinnedMessageBackgroundColor,
    messageStartMargin = messageStartMargin,
    messageEndMargin = messageEndMargin,
    messageMaxWidthFactorMine = messageMaxWidthFactorMine,
    messageMaxWidthFactorTheirs = messageMaxWidthFactorTheirs,
    showMessageDeliveryStatusIndicator = showMessageDeliveryStatusIndicator,
    iconFailedMessage = iconFailedMessage,
    iconBannedMessage = iconBannedMessage,
    systemMessageAlignment = systemMessageAlignment,
    loadingMoreView = loadingMoreView,
    unreadSeparatorBackgroundColor = unreadSeparatorBackgroundColor,
    unreadSeparatorTextStyle = unreadSeparatorTextStyle,
    messageDeletedBackground = randomInt(),
    textStyleMessageDeleted = mock(),
)

public fun randomViewReactionsViewStyle(
    bubbleBorderColorMine: Int = randomInt(),
    bubbleBorderColorTheirs: Int? = randomInt(),
    bubbleColorMine: Int = randomInt(),
    bubbleColorTheirs: Int = randomInt(),
    bubbleBorderWidthMine: Float = randomFloat(),
    bubbleBorderWidthTheirs: Float? = randomFloat(),
    totalHeight: Int = randomInt(),
    horizontalPadding: Int = randomInt(),
    itemSize: Int = randomInt(),
    bubbleHeight: Int = randomInt(),
    bubbleRadius: Int = randomInt(),
    largeTailBubbleCy: Int = randomInt(),
    largeTailBubbleRadius: Int = randomInt(),
    largeTailBubbleOffset: Int = randomInt(),
    smallTailBubbleCy: Int = randomInt(),
    smallTailBubbleRadius: Int = randomInt(),
    smallTailBubbleOffset: Int = randomInt(),
    verticalPadding: Int = randomInt(),
    messageOptionsUserReactionOrientation: Int = randomInt(),
    reactionSorting: ReactionSorting = mock(),
): ViewReactionsViewStyle = ViewReactionsViewStyle(
    bubbleBorderColorMine = bubbleBorderColorMine,
    bubbleBorderColorTheirs = bubbleBorderColorTheirs,
    bubbleColorMine = bubbleColorMine,
    bubbleColorTheirs = bubbleColorTheirs,
    bubbleBorderWidthMine = bubbleBorderWidthMine,
    bubbleBorderWidthTheirs = bubbleBorderWidthTheirs,
    totalHeight = totalHeight,
    horizontalPadding = horizontalPadding,
    itemSize = itemSize,
    bubbleHeight = bubbleHeight,
    bubbleRadius = bubbleRadius,
    largeTailBubbleCy = largeTailBubbleCy,
    largeTailBubbleRadius = largeTailBubbleRadius,
    largeTailBubbleOffset = largeTailBubbleOffset,
    smallTailBubbleCy = smallTailBubbleCy,
    smallTailBubbleRadius = smallTailBubbleRadius,
    smallTailBubbleOffset = smallTailBubbleOffset,
    verticalPadding = verticalPadding,
    messageOptionsUserReactionOrientation = messageOptionsUserReactionOrientation,
    reactionSorting = reactionSorting,
)

public fun randomEditReactionsViewStyle(
    bubbleColorMine: Int = randomInt(),
    bubbleColorTheirs: Int = randomInt(),
    horizontalPadding: Int = randomInt(),
    itemSize: Int = randomInt(),
    bubbleHeight: Int = randomInt(),
    bubbleRadius: Int = randomInt(),
    largeTailBubbleCyOffset: Int = randomInt(),
    largeTailBubbleRadius: Int = randomInt(),
    largeTailBubbleOffset: Int = randomInt(),
    smallTailBubbleCyOffset: Int = randomInt(),
    smallTailBubbleRadius: Int = randomInt(),
    smallTailBubbleOffset: Int = randomInt(),
    reactionsColumn: Int = randomInt(),
    verticalPadding: Int = randomInt(),
): EditReactionsViewStyle = EditReactionsViewStyle(
    bubbleColorMine = bubbleColorMine,
    bubbleColorTheirs = bubbleColorTheirs,
    horizontalPadding = horizontalPadding,
    itemSize = itemSize,
    bubbleHeight = bubbleHeight,
    bubbleRadius = bubbleRadius,
    largeTailBubbleCyOffset = largeTailBubbleCyOffset,
    largeTailBubbleRadius = largeTailBubbleRadius,
    largeTailBubbleOffset = largeTailBubbleOffset,
    smallTailBubbleCyOffset = smallTailBubbleCyOffset,
    smallTailBubbleRadius = smallTailBubbleRadius,
    smallTailBubbleOffset = smallTailBubbleOffset,
    reactionsColumn = reactionsColumn,
    verticalPadding = verticalPadding,
)

public fun randomGiphyViewHolderStyle(
    cardBackgroundColor: Int = randomInt(),
    cardElevation: Float = randomFloat(),
    cardButtonDividerColor: Int = randomInt(),
    giphyIcon: Drawable = mock(),
    labelTextStyle: TextStyle = mock(),
    queryTextStyle: TextStyle = mock(),
    cancelButtonTextStyle: TextStyle = mock(),
    shuffleButtonTextStyle: TextStyle = mock(),
    sendButtonTextStyle: TextStyle = mock(),
): GiphyViewHolderStyle = GiphyViewHolderStyle(
    cardBackgroundColor = cardBackgroundColor,
    cardElevation = cardElevation,
    cardButtonDividerColor = cardButtonDividerColor,
    giphyIcon = giphyIcon,
    labelTextStyle = labelTextStyle,
    queryTextStyle = queryTextStyle,
    cancelButtonTextStyle = cancelButtonTextStyle,
    shuffleButtonTextStyle = shuffleButtonTextStyle,
    sendButtonTextStyle = sendButtonTextStyle,
)

public fun randomAudioRecordPlayerViewStyle(
    height: Int = randomInt(),
    padding: ViewPadding = randomViewPadding(),
    backgroundDrawable: Drawable? = null,
    backgroundDrawableTint: Int? = randomInt(),
    playbackProgressContainerSize: ViewSize = randomViewSize(),
    playbackButtonSize: ViewSize = randomViewSize(),
    playbackButtonPadding: ViewPadding = randomViewPadding(),
    playbackButtonElevation: Int = randomInt(),
    playbackButtonBackground: Drawable? = null,
    playbackButtonBackgroundTint: Int? = randomInt(),
    progressBarDrawable: Drawable? = null,
    progressBarDrawableTint: Int? = randomInt(),
    progressBarSize: ViewSize = randomViewSize(),
    playIconDrawable: Drawable? = null,
    playIconDrawableTint: Int? = randomInt(),
    pauseIconDrawable: Drawable? = null,
    pauseIconDrawableTint: Int? = randomInt(),
    durationTextViewSize: ViewSize = randomViewSize(),
    durationTextMarginStart: Int = randomInt(),
    durationTextStyle: TextStyle = mock(),
    waveBarHeight: Int = randomInt(),
    waveBarMarginStart: Int = randomInt(),
    waveBarColorPlayed: Int = randomInt(),
    waveBarColorFuture: Int = randomInt(),
    scrubberDrawable: Drawable? = null,
    scrubberDrawableTint: Int? = randomInt(),
    scrubberWidthDefault: Int = randomInt(),
    scrubberWidthPressed: Int = randomInt(),
    isFileIconContainerVisible: Boolean = randomBoolean(),
    fileIconContainerWidth: Int = randomInt(),
    audioFileIconDrawable: Drawable? = null,
    speedButtonTextStyle: TextStyle = mock(),
    speedButtonBackground: Drawable? = null,
    speedButtonBackgroundTint: Int? = randomInt(),
    speedButtonSize: ViewSize = randomViewSize(),
    speedButtonElevation: Int = randomInt(),
): AudioRecordPlayerViewStyle = AudioRecordPlayerViewStyle(
    height = height,
    padding = padding,
    backgroundDrawable = backgroundDrawable,
    backgroundDrawableTint = backgroundDrawableTint,
    playbackProgressContainerSize = playbackProgressContainerSize,
    playbackButtonSize = playbackButtonSize,
    playbackButtonPadding = playbackButtonPadding,
    playbackButtonElevation = playbackButtonElevation,
    playbackButtonBackground = playbackButtonBackground,
    playbackButtonBackgroundTint = playbackButtonBackgroundTint,
    progressBarDrawable = progressBarDrawable,
    progressBarDrawableTint = progressBarDrawableTint,
    progressBarSize = progressBarSize,
    playIconDrawable = playIconDrawable,
    playIconDrawableTint = playIconDrawableTint,
    pauseIconDrawable = pauseIconDrawable,
    pauseIconDrawableTint = pauseIconDrawableTint,
    durationTextViewSize = durationTextViewSize,
    durationTextMarginStart = durationTextMarginStart,
    durationTextStyle = durationTextStyle,
    waveBarHeight = waveBarHeight,
    waveBarMarginStart = waveBarMarginStart,
    waveBarColorPlayed = waveBarColorPlayed,
    waveBarColorFuture = waveBarColorFuture,
    scrubberDrawable = scrubberDrawable,
    scrubberDrawableTint = scrubberDrawableTint,
    scrubberWidthDefault = scrubberWidthDefault,
    scrubberWidthPressed = scrubberWidthPressed,
    isFileIconContainerVisible = isFileIconContainerVisible,
    fileIconContainerWidth = fileIconContainerWidth,
    audioFileIconDrawable = audioFileIconDrawable,
    speedButtonTextStyle = speedButtonTextStyle,
    speedButtonBackground = speedButtonBackground,
    speedButtonBackgroundTint = speedButtonBackgroundTint,
    speedButtonSize = speedButtonSize,
    speedButtonElevation = speedButtonElevation,
)

public fun randomViewSize(
    width: Int = randomInt(),
    height: Int = randomInt(),
): ViewSize = ViewSize(width, height)

public fun randomViewPadding(
    start: Int = randomInt(),
    top: Int = randomInt(),
    end: Int = randomInt(),
    bottom: Int = randomInt(),
): ViewPadding = ViewPadding(start, top, end, bottom)

public fun randomMessageReplyStyle(
    messageBackgroundColorMine: Int = randomInt(),
    messageBackgroundColorTheirs: Int = randomInt(),
    linkBackgroundColorMine: Int = randomInt(),
    linkBackgroundColorTheirs: Int = randomInt(),
    textStyleMine: TextStyle = mock(),
    textStyleTheirs: TextStyle = mock(),
    linkStyleMine: TextStyle = mock(),
    linkStyleTheirs: TextStyle = mock(),
    messageStrokeColorMine: Int = randomInt(),
    messageStrokeWidthMine: Float = randomFloat(),
    messageStrokeColorTheirs: Int = randomInt(),
    messageStrokeWidthTheirs: Float = randomFloat(),
): MessageReplyStyle = MessageReplyStyle(
    messageBackgroundColorMine = messageBackgroundColorMine,
    messageBackgroundColorTheirs = messageBackgroundColorTheirs,
    linkBackgroundColorMine = linkBackgroundColorMine,
    linkBackgroundColorTheirs = linkBackgroundColorTheirs,
    textStyleMine = textStyleMine,
    textStyleTheirs = textStyleTheirs,
    linkStyleMine = linkStyleMine,
    linkStyleTheirs = linkStyleTheirs,
    messageStrokeColorMine = messageStrokeColorMine,
    messageStrokeWidthMine = messageStrokeWidthMine,
    messageStrokeColorTheirs = messageStrokeColorTheirs,
    messageStrokeWidthTheirs = messageStrokeWidthTheirs,
)

public fun randomUnreadLabelButtonStyle(
    unreadLabelButtonEnabled: Boolean = randomBoolean(),
    unreadLabelButtonColor: Int = randomInt(),
    unreadLabelButtonRippleColor: Int = randomInt(),
    unreadLabelButtonTextStyle: TextStyle = mock(),
): UnreadLabelButtonStyle = UnreadLabelButtonStyle(
    unreadLabelButtonEnabled = unreadLabelButtonEnabled,
    unreadLabelButtonColor = unreadLabelButtonColor,
    unreadLabelButtonRippleColor = unreadLabelButtonRippleColor,
    unreadLabelButtonTextStyle = unreadLabelButtonTextStyle,
)
